package ua.kharkov.gritsay;

import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class LinksParser {
 
    public static void main(String[] args) {
        Document doc = null;
        try {
            doc = Jsoup.connect("http://webfree.in.ua/klishe").userAgent("Mozilla/5.0 (Windows NT 6.2; rv:21.0) Gecko/20100101 Firefox/21.0").get();
        } catch (IOException e) {
            e.printStackTrace();
        }
        Elements links = doc.select("a[href]");
        String title = doc.title();
        System.out.println(title);
        int count =1;
        for (Element link : links) {
            System.out.println(count + " " +link.attr("href") + "  " + link.attr("title"));
            count++;
        }
    }
}